package thirdassigment;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;



public class Controller {
	static ICommandExecutor ie;
	
		 
		/*String[] str_mas = str.split(" ");
	    String command = str_mas[0];
	    
	    Factory f = new Factory();
	    ie=f.getExecutor(command);
	    if(ie!=null){
	    	ie.execute(str);
	    }*/
	    
	

	public void executeCommand(String cmd) throws FileNotFoundException, IOException {
		// TODO Auto-generated method stub
		String[] str_mas = cmd.split(" ");
	    String command = str_mas[0];
	    
	    Factory f = new Factory();
	    ie=f.getExecutor(command);
	    if(ie!=null){
	    	ie.execute(cmd);
	    }
	}
}
	    



	
	
		



